import datetime
from flask_login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
from applications.extensions import db


class Device_borrow(db.Model, UserMixin):
    __tablename__ = 'admin_device_borrow'
    id = db.Column(db.Integer, primary_key=True, autoincrement=True, comment='设备ID')
    deviceId = db.Column(db.Integer, comment='设备ID')
    borrowerId = db.Column(db.Integer, comment='借出人ID')
    status = db.Column(db.Integer, comment='是否超时，2归还,1正常借出，0超时')
    borrow_at = db.Column(db.DateTime, default=datetime.datetime.now, comment='借出日期')
    return_at = db.Column(db.DateTime, comment='归还日期')
    pay_money = db.Column(db.Float, comment='罚款金额')

